home *** CD-ROM | disk | FTP | other *** search
/ PsL Monthly 1993 December / PSL Monthly Shareware CD-ROM (December 1993).iso / prgmming / win / vb / vbmsngr.exe / MDIMENU.FRM (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1993-05-28  |  7.5 KB  |  253 lines

  1. VERSION 2.00
  2. Begin MDIForm MDIForm1 
  3.    Caption         =   "Menu Demonstration"
  4.    Height          =   4725
  5.    Left            =   4785
  6.    LinkTopic       =   "MDIForm1"
  7.    Top             =   3630
  8.    Width           =   7740
  9.    Begin PictureBox Picture1 
  10.       Align           =   2  'Align Bottom
  11.       BackColor       =   &H00C0C0C0&
  12.       FontBold        =   0   'False
  13.       FontItalic      =   0   'False
  14.       FontName        =   "MS Sans Serif"
  15.       FontSize        =   8.25
  16.       FontStrikethru  =   0   'False
  17.       FontUnderline   =   0   'False
  18.       Height          =   300
  19.       Left            =   0
  20.       ScaleHeight     =   270
  21.       ScaleWidth      =   7590
  22.       TabIndex        =   0
  23.       Top             =   3735
  24.       Width           =   7620
  25.       Begin VBMsg VBMsg1 
  26.          Height          =   420
  27.          Left            =   7080
  28.          MessageCount    =   MDIMENU.FRX:0000
  29.          MessageList     =   MDIMENU.FRX:0002
  30.          MessageTypes    =   0  'Selected Messages
  31.          Top             =   0
  32.          Width           =   420
  33.       End
  34.    End
  35.    Begin Menu file 
  36.       Caption         =   "&File"
  37.       Begin Menu new 
  38.          Caption         =   "&New"
  39.       End
  40.       Begin Menu Open 
  41.          Caption         =   "&Open..."
  42.       End
  43.       Begin Menu save 
  44.          Caption         =   "&Save"
  45.       End
  46.       Begin Menu saveas 
  47.          Caption         =   "Save &As..."
  48.       End
  49.       Begin Menu saveall 
  50.          Caption         =   "Sav&e All"
  51.       End
  52.       Begin Menu close 
  53.          Caption         =   "&Close"
  54.       End
  55.       Begin Menu sep13 
  56.          Caption         =   "-"
  57.       End
  58.       Begin Menu print 
  59.          Caption         =   "&Print..."
  60.          Shortcut        =   ^P
  61.       End
  62.       Begin Menu setup 
  63.          Caption         =   "P&rint Setup..."
  64.       End
  65.       Begin Menu sep11 
  66.          Caption         =   "-"
  67.       End
  68.       Begin Menu exit 
  69.          Caption         =   "E&xit"
  70.       End
  71.    End
  72.    Begin Menu edit 
  73.       Caption         =   "&Edit"
  74.       Begin Menu undo 
  75.          Caption         =   "&Undo"
  76.          Shortcut        =   ^Z
  77.       End
  78.       Begin Menu sep4 
  79.          Caption         =   "-"
  80.       End
  81.       Begin Menu cut 
  82.          Caption         =   "Cu&t"
  83.          Shortcut        =   ^X
  84.       End
  85.       Begin Menu copy 
  86.          Caption         =   "&Copy"
  87.          Shortcut        =   ^C
  88.       End
  89.       Begin Menu paste 
  90.          Caption         =   "&Paste"
  91.          Shortcut        =   ^V
  92.       End
  93.       Begin Menu sep3 
  94.          Caption         =   "-"
  95.       End
  96.       Begin Menu find 
  97.          Caption         =   "&Find..."
  98.          Shortcut        =   ^F
  99.       End
  100.       Begin Menu next 
  101.          Caption         =   "Find &Next"
  102.          Shortcut        =   {F3}
  103.       End
  104.       Begin Menu replace 
  105.          Caption         =   "R&eplace"
  106.       End
  107.    End
  108.    Begin Menu windows 
  109.       Caption         =   "&Window"
  110.       WindowList      =   -1  'True
  111.       Begin Menu newwindow 
  112.          Caption         =   "&New Window"
  113.       End
  114.       Begin Menu casc 
  115.          Caption         =   "&Cascade"
  116.       End
  117.       Begin Menu tile 
  118.          Caption         =   "&Tile"
  119.       End
  120.       Begin Menu arran 
  121.          Caption         =   "&Arrange Icons"
  122.       End
  123.    End
  124.    Begin Menu help 
  125.       Caption         =   "&Help"
  126.       Begin Menu cont 
  127.          Caption         =   "&Contents"
  128.       End
  129.       Begin Menu serrarc 
  130.          Caption         =   "&Search for Help On..."
  131.       End
  132.       Begin Menu how 
  133.          Caption         =   "&How to Use Help"
  134.       End
  135.       Begin Menu sep9 
  136.          Caption         =   "-"
  137.       End
  138.       Begin Menu about 
  139.          Caption         =   "&About..."
  140.       End
  141.    End
  142. Option Explicit
  143. Const MF_SYSMENU = &H2000
  144. Const MF_SEPARATOR = &H800
  145. Sub arran_Click ()
  146.     MDIForm1.Arrange 3
  147. End Sub
  148. Sub casc_Click ()
  149.     MDIForm1.Arrange 0
  150. End Sub
  151. Sub edit_Click ()
  152.     Picture1.Cls
  153.     Picture1.Print "  Undo Last Changes, Perform Clipboard Operations, Search and Replace"
  154. End Sub
  155. Sub exit_Click ()
  156.     End
  157. End Sub
  158. Sub file_Click ()
  159.     Picture1.Cls
  160.     Picture1.Print "  Create, Open, Save, Print or Close Documents, Setup the Printer, or Ext the Application"
  161. End Sub
  162. Sub help_Click ()
  163.     Picture1.Cls
  164.     Picture1.Print " Get Help on the Application"
  165. End Sub
  166. Sub MDIForm_Load ()
  167.     Load Form1  ' Load original Form1.
  168.     Form1.Print "Use the mouse to drag through the"
  169.     Form1.Print "menu items above.  Notice on the status"
  170.     Form1.Print "line the text associated with the item."
  171.     Form1.Print "VB Messenger is detecting when the MDI"
  172.     Form1.Print "parent form gets a WM_MENUSELECT message "
  173.     Form1.Print "and interprets the results to print a "
  174.     Form1.Print "line of text describing the menu item."
  175.     VBMsg1.SubClasshWnd = MDIForm1.hWnd
  176. End Sub
  177. Sub newwindow_Click ()
  178.     Static i As Integer
  179.     i = i + 1
  180.     ReDim Preserve F(i) As New Form1
  181.     F(i).Caption = "Child Window"
  182.     F(i).Show
  183. End Sub
  184. Sub tile_Click ()
  185.     MDIForm1.Arrange 1
  186. End Sub
  187. Sub VBMsg1_WindowMessage (hWindow As Integer, Msg As Integer, wParam As Integer, lParam As Long, RetVal As Long, CallDefProc As Integer)
  188.     Dim Dil As String
  189.     Dim rc As Integer
  190.     Dim MenuID As String * 40
  191.     VBMsg1.lParam = lParam  'parse out LoWord and HiWord values
  192.     Select Case wParam
  193.         Case 2
  194.             Dil = "Create a New Document"
  195.         Case 3
  196.             Dil = "Open an Existing Document"
  197.         Case 4
  198.             Dil = "Save the Document in the Active Window"
  199.         Case 5
  200.             Dil = "Save the Active Document under a New Name"
  201.         Case 6
  202.             Dil = "Save All the Open Documents"
  203.         Case 7
  204.             Dil = "Close the Active Document"
  205.         Case 9
  206.             Dil = "Print the Active Document"
  207.         Case 10
  208.             Dil = "Change Printer Settings"
  209.         Case 12
  210.             Dil = "Exit the Demo Application"
  211.         Case 14
  212.             Dil = "Undo the Last Changes"
  213.         Case 16
  214.             Dil = "Delete the Selected Text and Copy it into the Clipboard"
  215.         Case 17
  216.             Dil = "Copy the Selected Text into the Clipboard"
  217.         Case 18
  218.             Dil = "Paste the Clipboard Contents into the Active Window"
  219.         Case 20
  220.             Dil = "Find a Specified String in the Active Window"
  221.         Case 21
  222.             Dil = "Find the Next Matching String"
  223.         Case 22
  224.             Dil = "Replace a String in the Active Window"
  225.         Case 24
  226.             Dil = "Create a New Window with the Same Contents as the Active Window"
  227.         Case 25
  228.             Dil = "Cascade the Open Windows"
  229.         Case 26
  230.             Dil = "Tile the Open Windows"
  231.         Case 27
  232.             Dil = "Rearrange All Icons"
  233.         Case 29
  234.             Dil = "Display Help Contents"
  235.         Case 30
  236.             Dil = "Search for a Specific Help Topic"
  237.         Case 31
  238.             Dil = "Display Help on Using Windows Help"
  239.         Case 33
  240.             Dil = "Display Version Information About the Application"
  241.         Case Is < 0
  242.             Dil = "Make the Specified Window the Active Window"
  243.         Case Else
  244.             Dil = ""
  245.     End Select
  246.     Picture1.Cls
  247.     Picture1.Print "  " + Dil
  248. End Sub
  249. Sub windows_Click ()
  250.     Picture1.Cls
  251.     Picture1.Print "  Manage Child Windows"
  252. End Sub
  253.